﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="AJAXAutoComplete.aspx.vb"
    Inherits="ProjetoDeTestes.AJAXAutoComplete" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="stylesheets/common.css" rel="stylesheet" type="text/css" />

    <script src="javascripts/unittest.js" type="text/javascript"></script>
   
    <script src="javascripts/controls.js" type="text/javascript"></script>
    <script src="javascripts/dragdrop.js" type="text/javascript"></script>
    <script src="javascripts/controls.js" type="text/javascript"></script>
    <script src="javascripts/prototype.js" type="text/javascript"></script>
    <script src="javascripts/effects.js" type="text/javascript"></script>
     <script src="javascripts/builder.js" type="text/javascript"></script>
    <script src="javascripts/application.js" type="text/javascript"></script>
</head>
<body>

    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Services>
            <asp:ServiceReference Path="wsAJAXAutoComplete.asmx" />
        </Services>
    </asp:ScriptManager>
    <div>
        <table cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    
                </td>
                <td>
                    <asp:TextBox ID="TextBox1" runat="server" Width="400px"></asp:TextBox>
                </td>
                <td>
                    <asp:Button ID="Button1" runat="server" Text="Button" />
                </td>
                <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" 
                    ServicePath="~/wsAJAXAutoComplete.asmx" ServiceMethod="ListaNomes" MinimumPrefixLength="1" TargetControlID="TextBox1"
                     CompletionSetCount="10">
                </asp:AutoCompleteExtender>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">
                     <div tabindex="-1" id="ids" class="clearfix tokenizer" onclick="$('autocomplete_input').focus()">
                            <span class="tokenizer_stretcher"></span><span class="tab_stop"><input type="text" id="hidden_input" tabindex="-1"></span>
                    	    
							
                            <div id="autocomplete_display" class="tokenizer_input">
                                            <input type="text" size="1" tabindex="" id="autocomplete_input"   />
                            </div>                                                                          
                        </div>
                        <div id="autocomplete_populate" class="clearfix autocomplete typeahead_list" style="width: 358px; height: auto; overflow-y: hidden;display:none">

                                <div class="typeahead_message">Type the name of a friend, friend list, or email address</div>                       
                        </div>  
                        <script type="text/javascript">
                            // preload images.
                            (new Image()).src = 'inbox/images/token.gif';
                            (new Image()).src = 'inbox/images/token_selected.gif';
                            (new Image()).src = 'inbox/images/token_hover.gif';
                            (new Image()).src = 'inbox/images/token_x.gif';

                            var contacts = [
                                            { name: "phoenix zhuang", email: "phoenix@rorcraft.com" },
                                            { name: "jian xie", email: "jan.xie@rorcraft.com" },
                                            { name: "isaiah peng", email: "isaiah.peng@rorcraft.com" },
                                            { name: "chris chan", email: "chris.chan@rorcraft.com" },
                                            { name: "rex chung", email: "rex@rorcraft.com" },
                                            { name: "chung rex", email: "chung@rorcraft.com" },
                                            { name: "chan chris", email: "chan@rorcraft.com" },
                                            { name: "peng isaiah", email: "peng@rorcraft.com" },
 						                    { name: "albert chang", email: "albert@yahoo.com"}];


                            var typeahead = new Autocompleter.LocalAdvanced('autocomplete_input', 'autocomplete_populate', contacts, {
                                frequency: 0.1,
                                updateElement: addContactToList,
                                search_field: "name"
                            });
                            var hidden_input = new HiddenInput('hidden_input', typeahead);

                        </script> &nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:GridView ID="GridView1" runat="server">
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
